package com.doctorliang.cheng.addsub;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

    private NumberAddSubView addSubView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        addSubView = (NumberAddSubView) findViewById(R.id.add_sub_view);
        addSubView.setOnNumberChangeListener(new NumberAddSubView.OnNumberChangeListener() {
            @Override
            public void onNumberChange(int value) {
                Toast.makeText(MainActivity.this, "当前商品数=="+value, Toast.LENGTH_SHORT).show();
            }
        });
    }
}
